<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基础柱状图</title>
    <script src="../../echarts.min.js"></script>
</head>
<body>
    <div id="main" style="height: 400px;width: 600px;"></div>
</body>
<script>
    let mychart = echarts.init(document.getElementById("main"))
    let option = {
        title:{
            text:"基础柱状图",
            left:"center"
        },
        legend:{
            data:["产品销量"],
            left:"right"
        },
        xAxis:{
            type:"category",
            data:["Mon","Tue","Wed","Thr","Fri","Sat","Sun"]
        },
        yAxis:{
            type:"value"
        },
        series:[{
            name:"产品销量",
            type:"bar",
            data:[520,114,514,420,810,515,650],
            //添加label以显示具体数值
            label:{
                show:true,
                position:'top'
            }
        }]
    }
    mychart.setOption(option)
</script>
</html>